vtd: fix multiple Dom0 S3 on hosts that support Queued Invalidation.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 31 Mar 2009 10:54:12 +0000 (11:54 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 31 Mar 2009 10:54:12 +0000 (11:54 +0100)
commitbc0fe8ff74c3e462c9d637eb3e93645f0b97a3f8
tree75751682cb1edb406386658d1434e2be355b4ba9
parent964fae8ac2fa6732856179a2532b0914dba5e4bb
vtd: fix multiple Dom0 S3 on hosts that support Queued Invalidation.

On such hosts we can't do multiple Dom0 S3 when VT-d is enabled.
The cause is: during the first S3 resume, init_vtd_hw() initializes
the invalidation function pointers to the register-based ones and later
enable_qinval() forgets to overwrite the flush function pointers to
queued-based ones, so actually Queued Invalidaton is enabled, but we
actually use the register-based invalidation function! Later during
the second Dom0 S3, in iommu_suspend() -> iommu_flush_all(), we try to
use the register-based invalidation functions to perform global flush
while Queued Invalidation is enabled, and this can cause a host reset
because VT-d spec says: when the queued invalidation is enabled,
software must submit invalidation commands only through the IQ (and
not through any invalidation command registers).

The attached patch fixes the buggy enable_qinval(). And in
iommu_resume(), we invoke iommu_flush_all() for safety.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/qinval.c